# -*- coding:utf-8 -*-
class Solution:
    def reOrderArray(self, array):
        # write code here
        res = [0 for _ in range(len(array))]
        odd_num = 0
        for i in range(len(array)):
            if array[i] % 2:
                odd_num += 1
        l = 0
        r = odd_num
        for i in range(len(array)):
            if array[i] % 2:
                res[l] = array[i]
                l += 1
            else:
                res[r] = array[i]
                r += 1
        return res
test = Solution()
test.reOrderArray([1,2,3,4,5,6,7])